<template>
  <div class="package-box">
    <box-item
      label="有无面单"
      :value="order.shippingType ? '有' : '无'"
    ></box-item>
    <template v-if="order.shippingType">
      <box-item
        label="面单文件"
      >
        <template #value>
          <shipping-link :file="order.pdfPath"></shipping-link>
        </template>
      </box-item>
    </template>
    <template v-else>
      <box-item
        :label="$t('packet.收件人')"
        :value="order.buyerName"
      ></box-item>
      <box-item
        :label="$t('联系电话')"
        :value="order.buyerPhone"
      ></box-item>
      <box-item
        :label="$t('邮编')"
        :value="order.buyerPostalCode"
      ></box-item>
      <box-item
        :label="$t('地区')"
        :value="order.buyerState + ' / ' + order.buyerCity"
        v-if="order.isAddressOperation === false"
      ></box-item>
      <box-item
        :label="$t('packet.州')"
        :value="order.operationBuyerState"
        v-if="order.isAddressOperation === true"
      ></box-item>
      <box-item
        :label="$t('packet.城市')"
        :value="order.operationBuyerCity"
        v-if="order.isAddressOperation === true"
      ></box-item>
      <box-item
        :label="$t('详细地址')"
        :value="order.buyerAddress"
      ></box-item>
    </template>

  </div>
</template>

<script>
import BoxItem from "@/views/packetOrders/components/BoxItem.vue";
import ShippingLink from "@/views/packetOrders/components/ShippingLink.vue";

export default {
  components: {ShippingLink, BoxItem},
  props: {
    order: {
      required: true,
      type: Object,
      default() {
        return {};
      },
    }
  },
  data() {
    return {}
  },
  created() {

  },
  methods: {

  }
}
</script>

<style scoped lang="less">
.package-box{
  border: 1px solid #D7D7D7;
  width: 420px;
}
</style>
